package dome1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2024-05-22
 * Time: 19:45
 */
public class Animal extends Creature{
    public String name;
    public int age;

    {
        System.out.println("Animal类的实例代码块被执行了...");
    }
    static{
        System.out.println("Animal类的静态代码块被执行了...");
    }
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Animal类的构造方法被执行了...");
    }

    public void eat() {
        System.out.println(this.name + "正在吃饭...");
    }
}
